package com.aaa.controller;

import com.aaa.service.MenuService;
import com.aaa.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.Arrays;

@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    //获取当前用户的左侧菜单
    @RequestMapping("/getMenu")
    @ResponseBody
    public R getMenu(){
        //获取当前登录的信息.
        R r = menuService.getMenu();
        return r;
    }
    //测试接口--postman
    @RequestMapping("/listByRoleId")
    @ResponseBody
    public R listByRoleId(Integer roleId){
        R r = menuService.findByRoleId(roleId);
        return r;
    }

    @RequestMapping("/confirmFen")
    @ResponseBody
    public R confirmFen(Integer roleid,Integer[] cids){
        return menuService.confirmFen(roleid,cids);
    }
}
